from flask import Flask
from flask import render_template

xiaoshuo = [
    {"book_name": "《万族之劫》", "book_type": "必读", "author": "老鹰吃小鸡", "public": "起点中文网"},
    {"book_name": "《我师兄实在太稳健了》", "book_type": "必读", "author": "言归正传", "public": "起点中文网"},
    {"book_name": "《大奉打更人》", "book_type": "必读", "author": "卖报小郎君", "public": "起点中文网"},
    {"book_name": "《我的徒弟都是大反派》", "book_type": "必读", "author": "谋生任转蓬", "public": "起点中文网"},
    {"book_name": "《一念永恒》", "book_type": "必读", "author": "耳根", "public": "起点中文网"},
]
tonghua = [
    {"book_name": "《春天在哪里》", "book_type": "必读", "author": "葛翠林", "public": "中国少年儿童出版社"},
    {"book_name": "《萝卜回来了》", "book_type": "必读", "author": "方轶群", "public": "中国少年儿童出版社"},
    {"book_name": "《神秘铜面狗》", "book_type": "必读", "author": "葛冰", "public": "江苏少年儿童出版社"},
    {"book_name": "《开出租的狐小小》", "book_type": "必读", "author": "葛冰", "public": "21世纪出版社"},
    {"book_name": "《双面猎犬》", "book_type": "必读", "author": "沈石溪", "public": "浙江少年儿童出版社"},
]
zazhi = [
    {"book_name": "《读者》", "book_type": "必读", "public": "甘肃人民出版社"},
    {"book_name": "《知音》", "book_type": "必读", "public": "湖北知音传媒集团"},
    {"book_name": "《中国国家地理》", "book_type": "必读", "public": "《中国国家地理》杂志社"},
    {"book_name": "《瑞丽》", "book_type": "必读", "public": "北京《瑞丽》杂志社"},
    {"book_name": "《半月谈》", "book_type": "必读", "public": "新华通讯社"},
]
manhua = [
    {"book_name": "《斗破苍穹》", "book_type": "必读", "author": "任翔", "public": "中国致公出版社"},
    {"book_name": "《一拳超人》", "book_type": "必读", "author": "村田雄介", "public": "集英社"},
    {"book_name": "《斗罗大陆》", "book_type": "必读", "author": "穆逢春", "public": "中国致公出版社"},
    {"book_name": "《风起苍岚》", "book_type": "必读", "author": "松鼠200", "public": "黑龙江美术出版社"},
    {"book_name": "《武动乾坤》", "book_type": "必读", "author": "绿光", "public": "湖南少年儿童出版社"},
]
jiaofu = [
    {"book_name": "《飞扬》", "book_type": "必读", "author": "省登宇", "public": "国际文化出版社"},
    {"book_name": "《小学生好词好句好段活学巧用》", "book_type": "必读", "author": "张光璎", "public": "云南教育出版社"},
    {"book_name": "《语文报杯全国作文大赛历届获奖作品精选》", "book_type": "必读", "author": "何桦", "public": "湖南人民出版社"},
    {"book_name": "《天空之上》", "book_type": "必读", "author": "萌芽", "public": "人民文学出版社"},
    {"book_name": "《写作素材》", "book_type": "必读", "author": "王海洋", "public": ":重庆出版社"},
]
all = {
    'xiaoshuo': xiaoshuo,
    'tonghua': tonghua,
    'zazhi': zazhi,
    'jiaofu':jiaofu,
    'manhua':manhua
}
app = Flask(__name__)
@app.route('/book_list/')
def book_list():
    return render_template("mulu.html")

@app.route('/book_list/<cls>/')
def lst (cls):
    return render_template("{}.html".format(cls),name=all.get(cls))

if __name__ == '__main__':
    app.run()